home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Tools 5
/
Amiga Tools 5.iso
/
grafik
/
3d & render tools
/
irit
/
man
/
man6
/
printf.6
< prev
next >
Wrap
Text File
|
1996-07-16
|
2KB
|
58 lines
.TH PRINTF
6 "IRIT Version 6.0"
.SH NAME
PRINTF
PRINTF( StringType CtrlStr, ListType Data )
A formatted printing routine, following the concepts of the C programming
language's printf routine. CtrlStr is a string object for which
the following special '%' commands are supported:
%d, %i, %u Prints the numeric object as an integer or unsigned integer.
%o, %x, %X Prints the numeric object as an octal or hexadecimal integer.
%e, %f, %g, Prints the numeric object in several formats of
%E, %F floating point numbers.
%s Prints the string object as a string.
%pe, %pf, %pg Prints the three coordinates of the point object.
%ve, %vf, %vg Prints the three coordinates of the vector object.
%Pe, %Pf, %Pg, Prints the four coordinates of the plane object.
%De, %Df, %Dg, Prints the given object in IRIT's data file format.
All the '%' commands can include any modifier that is valid in the C
programming language printf routine, including l (long), prefix
character(s), size, etc. The point, vector, plane, and object commands
can also be modified in a similar way, to set the format of the
numeric data printed.
Also supported are the newline and tab using the backslash escape
character:
PRINTF("\\tThis is the char \"\\%\"\\n", nil());
Backslashes should be escaped themselves as can be seen in the above example.
Here are few more examples:
PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
list("STRING", 1987));
PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
IritState("DumpLevel", 9);
PRINTF("this is a object %8.6lDf...\\n", list(axes));
PRINTF("this is a object %10.8lDg...\\n", list(axes));
This implementation of PRINTF is somewhat different than the C programming
language's version, because the backslash always escapes the next
character during the processing stage of IRIT's parser. That is, the string
'\\tThis is the char \"\\%\"\\n'
is actually parsed by the IRIT's parser into
'\tThis is the char "\%"\n'
because this is the way the IRIT parser processes strings. The latter
string is the one that PRINTF actually see.